home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / shareware / share_41 / assembler / examples / upper < prev   
Encoding:
Text File  |  1991-05-17  |  713 b   |  44 lines

  1. ; NAME       upper
  2. ; PURPOSE    copies text1 to text2 forcing upper case
  3. ; DESIGN    
  4. ;            get first character
  5. ;            while character is not terminator
  6. ;              if character ASCII code > 64
  7. ;              then
  8. ;                and character with #&DF
  9. ;              end if           
  10. ;              store character in text2
  11. ;              get next charater
  12. ;            end while
  13. ;            store character in text2
  14.                                   
  15. mov r8, #0
  16.   ldrb r6, [r4]
  17. .loop
  18.   cmp r6, #0
  19.   beq   done
  20.   cmp r6, #64
  21.   andge  r6, r6, #&DF
  22.   strb r6, [r5]
  23.   add r4, r4, #1
  24.   add r5, r5, #1
  25.   ldrb r6, [r4]
  26.   add r8, r8, #1
  27.   b loop
  28. .done
  29.   strb r6, [r5] 
  30.   str r8, [r1]
  31.   
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.